from app.model.base import *
from sqlalchemy import Index
from sqlalchemy.dialects.mysql import VARCHAR
from sqlalchemy import Column, String, TIMESTAMP, text

from app.model.base import *
from sqlalchemy import Index
import uuid
class Ai(Base):
    __tablename__ = 'ai'
    __table_args__ = {'comment': 'Ai'}

    id = Column(BIGINT(20), primary_key=True, comment='ai_id')
    name = Column(VARCHAR(255), nullable=False,comment='ai名称')
    avatar=Column(VARCHAR(255),nullable=False, comment='ai的头像')
    vector_name=Column(VARCHAR(255),nullable=False, comment='向量库名称',default=str(uuid.uuid4()),)
    info=Column(VARCHAR(255), nullable=False,server_default=text("''"),comment='概述',)
    greet=Column(VARCHAR(255), nullable=False,server_default=text("''"),comment='招呼语',)
    url = Column(String(255), nullable=False, comment='群二维码路径',)
    page=Column(VARCHAR(255), nullable=False,server_default=text("''"),comment='群二维码路径',)
    user_id = Column(BIGINT(20), nullable=False, comment='用户id')
    add_num = Column(BIGINT(20), nullable=False, comment='新增数')

indexes=[Index('user_ix', Ai.user_id),Index('mix_ix', Ai.is_deleted, Ai.user_id)]

